Upgrade to latest swig 4.1.1#1354
Merged
Merged
Conversation
Removes some system wide swig warning suppressions
Update the canary requirements to install the latest available `swig` package instead of the previously pinned 4.3.1 range. Also extend the shared build action's pip cache dependency paths to include the `.github/workflows` requirement files so canary dependency changes correctly invalidate the pip cache and are reflected in CI.
We now support swig 4.4.1 which eliminates the need for this.
This version had some regressions that caused the BSK build to fail. This is fixed in swig 4.4.1
Add local pytest cleanup for ResourceWarning messages emitted when running the test suite with pytest-xdist and pytest-rerunfailures. The rerunfailures plugin creates localhost sockets to coordinate rerun state between the xdist controller and workers, but version 16.1 does not close all of those sockets before Python interpreter shutdown. Update src/conftest.py to close the plugin-owned failures_db socket during pytest_unconfigure(). Also wrap pytest-rerunfailures ServerStatusDB connection handling so accepted server-side sockets are closed when their handler exits. This preserves rerunfailures behavior while preventing unclosed socket warnings during parallel pytest runs. Also keep reportconf.py loading inside a context manager so pytest-html report configuration does not leave an open file handle. Verified with: - pytest -q -n 2 src/architecture/messaging/_UnitTest/test_CMsgTimeWritten.py - pytest -q -n 2 src/simulation/environment/spiceInterface/_UnitTest/test_spiceThreadSafety.py - pytest -n auto from src
4541895 to
377e546
Compare
schaubh
added a commit
that referenced
this pull request
Apr 12, 2026
ReeceHumphreys
approved these changes
Apr 12, 2026
Contributor
ReeceHumphreys
left a comment
There was a problem hiding this comment.
Looks good. For users on the bad swig version should we document anywhere that they should run pip install --upgrade swig to fix it? Maybe in the release notes?
377e546 to
bd4a7a5
Compare
schaubh
added a commit
that referenced
this pull request
Apr 13, 2026
Removes some system wide swig warning suppressions
schaubh
added a commit
that referenced
this pull request
Apr 13, 2026
Update the canary requirements to install the latest available `swig` package instead of the previously pinned 4.3.1 range. Also extend the shared build action's pip cache dependency paths to include the `.github/workflows` requirement files so canary dependency changes correctly invalidate the pip cache and are reflected in CI.
schaubh
added a commit
that referenced
this pull request
Apr 13, 2026
We now support swig 4.4.1 which eliminates the need for this.
schaubh
added a commit
that referenced
this pull request
Apr 13, 2026
This version had some regressions that caused the BSK build to fail. This is fixed in swig 4.4.1
schaubh
added a commit
that referenced
this pull request
Apr 13, 2026
schaubh
added a commit
that referenced
this pull request
Apr 13, 2026
schaubh
added a commit
that referenced
this pull request
Apr 13, 2026
Add local pytest cleanup for ResourceWarning messages emitted when running the test suite with pytest-xdist and pytest-rerunfailures. The rerunfailures plugin creates localhost sockets to coordinate rerun state between the xdist controller and workers, but version 16.1 does not close all of those sockets before Python interpreter shutdown. Update src/conftest.py to close the plugin-owned failures_db socket during pytest_unconfigure(). Also wrap pytest-rerunfailures ServerStatusDB connection handling so accepted server-side sockets are closed when their handler exits. This preserves rerunfailures behavior while preventing unclosed socket warnings during parallel pytest runs. Also keep reportconf.py loading inside a context manager so pytest-html report configuration does not leave an open file handle. Verified with: - pytest -q -n 2 src/architecture/messaging/_UnitTest/test_CMsgTimeWritten.py - pytest -q -n 2 src/simulation/environment/spiceInterface/_UnitTest/test_spiceThreadSafety.py - pytest -n auto from src
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR updates Basilisk test and build infrastructure for cleaner Python 3.14 support.
First, the branch updates SWIG dependency handling so Basilisk supports the latest working SWIG release. Local development requirements now allow current SWIG versions while explicitly excluding
swig==4.4.0, which produced compile failures in testing. SWIG 4.4.1 was verified with a clean Basilisk build and unit test run. The canary CI requirements continue to use the latest available SWIG so future compatibility issues are detected early.Second, this PR removes obsolete SWIG runtime warning suppression that was previously hiding Python warnings such as
swigvarlink has no __module__ attribute. With SWIG 4.4.1, those warnings no longer appear in the clean build/test path, so the suppression is no longer needed.Finally, this PR cleans up Python test-suite
ResourceWarningmessages observed when runningpytest -n autofromsrc. The warnings were traced to pytest infrastructure rather than Basilisk simulation code. The SPICE thread-safety test now closes multiprocessing queue and process resources explicitly. The pytest configuration also closes the optionalreportconf.pyfile handle after loading it.The remaining socket warnings were isolated to the interaction between
pytest-xdistandpytest-rerunfailures16.1. Since there is not yet a newer releasedpytest-rerunfailuresversion that fixes this cleanup path,src/conftest.pynow performs a narrow local cleanup: it closes the plugin-owned rerun status socket during pytest shutdown and wraps the plugin’s server-side connection handler so accepted sockets are closed when each handler exits.The commits are organized by infrastructure topic: SWIG version support, removal of obsolete SWIG warning suppression, SPICE multiprocessing cleanup, pytest file-handle cleanup, and pytest-rerunfailures socket cleanup.
Verification
SWIG 4.4.1 was verified with a clean Basilisk build. The previous SWIG runtime warnings were not observed in the clean build log, and the unit tests completed successfully. SWIG 4.4.0 was tested separately and produced compile failures, so that specific version is excluded from the pinned development dependency range.
Validated the ResourceWarning cleanup with warning tracing enabled:
Also verified the full parallel test suite from src:
pytest -n auto
The full run completed without the previously reported unclosed socket ResourceWarning.
No new tests were added because these changes update build/test infrastructure cleanup behavior rather than Basilisk runtime behavior. Existing build and test coverage was used to confirm the changes.
Documentation
No user-facing Basilisk documentation was invalidated. This change affects developer/test infrastructure and SWIG dependency compatibility.
Reviewers should check the requirements updates, the removed SWIG warning suppression, src/conftest.py for the local pytest-rerunfailures socket cleanup shim, and src/simulation/environment/spiceInterface/_UnitTest/test_spiceThreadSafety.py for multiprocessing queue/process cleanup behavior.
Future work
If pytest-rerunfailures releases an upstream fix for closing its xdist coordination sockets, the local cleanup shim in src/conftest.py can be removed after updating the pinned dependency range.